package com.example.jpa.crud.search;

import java.util.Collection;
import java.util.Collections;

public class PageResponse {

    private Long page;

    private Long size;

    private Long total;

    private Long totalPage;

    private Collection<?> data;

    public Long getPage() {
        return page;
    }

    public void setPage(Long page) {
        this.page = page;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public Long getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Long totalPage) {
        this.totalPage = totalPage;
    }

    public Collection<?> getData() {
        return data;
    }

    public void setData(Collection<?> data) {
        this.data = data;
    }

    public static PageResponse empty() {
        final PageResponse pageResponse = new PageResponse();
        pageResponse.page = 0L;
        pageResponse.size = 0L;
        pageResponse.total = 0L;
        pageResponse.totalPage = 0L;
        pageResponse.data = Collections.emptyList();
        return pageResponse;
    }

}
